﻿using System;
using System.ComponentModel;
using System.Windows.Media.Imaging;

namespace DAL.Clipboard
{
    public class ClipboardContent : INotifyPropertyChanged
    {
        private string path;
        public string Path
        {
            get { return path; }
            set { path = System.IO.Path.GetFullPath(value + @"\"); }
        }

        public DateTime Time { get; set; }

        public string Text { get; set; }
        public string Rtf { get; set; }
        public BitmapSource Image { get; set; }
        public string Html { get; set; }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        #endregion

        public void Merge(ClipboardContent newer)
        {
            if (newer == null)
                return;

            Time = newer.Time;

            if (newer.Text != null)
                Text = newer.Text;

            if (newer.Rtf != null)
                Rtf = newer.Rtf;

            if (newer.Image != null)
                Image = newer.Image;

            if (newer.Html != null)
                Html = newer.Html;
        }
    }
}
